Skip to content

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Jul 17, 2025

This pull-request improves the guess of the relevant file to point to by:

  1. introducing an exclusion list of filenames (defaults to SUMMARY.md)
  2. by sorting all the matching files by the total number of lines changed (additions + removals + changes)

This should drastically improve our guess as before we took the first file we match on.

cc @apiraino
Fixes #2116

@Urgau Urgau force-pushed the rendered-link-improv-guess branch from e877943 to fdbc0a9 Compare July 17, 2025 19:44
@Urgau Urgau force-pushed the rendered-link-improv-guess branch from fdbc0a9 to e06e1e9 Compare July 17, 2025 19:49
@Urgau Urgau force-pushed the rendered-link-improv-guess branch from e06e1e9 to 1496c0c Compare July 17, 2025 20:06
@apiraino
Copy link
Contributor

Did we understand what caused #2116? This feels like a (legit) workaround but I feel I didn't understand the root cause of it.

I infer that the reason is that we don't have a way to tell which .md files are more relevant for the rendered link, correct?

@Urgau
Copy link
Member Author

Urgau commented Jul 18, 2025

The root cause behind #2116 is that triagebot currently looks at the list of modified files from the PR and shows the first file to match one of the rules under trigger_files.

This is quite naïve from triagebot as it implicitly relies on the assumption that the most relevant modified file is always the first one in the PR, which it obviously isn't.

As a better metric this PR proposes that we use the total number of lines changed which should eliminate the index files (like SUMMARY.md or index.md) where only small changes are made compared to the rest from being linked in priority.

@Urgau Urgau added this pull request to the merge queue Jul 23, 2025
Merged via the queue into rust-lang:master with commit 872f2cb Jul 23, 2025
3 checks passed
@Urgau Urgau deleted the rendered-link-improv-guess branch July 23, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rendered link does not point to correct file
3 participants